home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / comm / fido / fz104.lha / rexx / Fz2BBS.rexx < prev    next >
OS/2 REXX Batch file  |  1992-06-01  |  888b  |  48 lines

  1. /*
  2.  *
  3.  *    Foozle.areas to AREAS.BBS Converter
  4.  *
  5.  *    Written 1992 by Peer Hasselmeyer
  6.  *
  7.  *
  8.  */
  9.  
  10.  
  11. if ~open(in, "Foozle.areas", "R") then do
  12.    say "No input file!"
  13.    exit 20
  14. end
  15.  
  16. if ~open(out, "Areas.BBS", "W") then do
  17.     say "No output file!"
  18.     exit 20
  19. end
  20.  
  21. do forever
  22.     yn = readch(in, 24)
  23.     if left(yn, 1) = "00"x then leave
  24.     nn = readch(in, 24)
  25.     name = left(nn, pos("00"x, nn) - 1)
  26.     dn = readch(in, 32)
  27.     dir = left(dn, pos("00"x, dn) - 1)
  28.     call seek in, 128, "C"
  29.     call writech out, "AREA" || "09"x || name || "09"x || dir || "09"x
  30.     offs = 520
  31.     do forever
  32.     z = c2d(readch(in, 2))
  33.     n = c2d(readch(in, 2))
  34.     o = c2d(readch(in, 2))
  35.     p = c2d(readch(in, 2))
  36.     offs = offs - 8
  37.     if z=0 then leave
  38.     call writech out, z || ":" || n || "/" || o || "." || p || " "
  39.     end
  40.     call writeln out, ""
  41.     call seek in, offs, "C"
  42. end
  43.  
  44. call close out
  45. call close in
  46. exit 0
  47.  
  48.